package com.mo.web;


import com.mo.pojo.SysRole;
import com.mo.service.SysRoleService;
import com.mo.web.pojo.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RequestMapping("/role/")
@RestController
public class SysRoleController {
    @Autowired
    private SysRoleService sysRoleService;


    @GetMapping("checkRoles")
    public JsonResult doFindCheckRoles(){
         return new JsonResult(sysRoleService.findCheckRoles());
    }


    @GetMapping("{id}")
    private JsonResult doFindById(@PathVariable Integer id){
        return new JsonResult(sysRoleService.findById(id));
    }







    @GetMapping
    public JsonResult doFindRoles(SysRole entity){
        return new JsonResult(sysRoleService.findRoles(entity));

    }





}
